home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / dvi2ps / dvi-to-ps / dvi2ps.h < prev    next >
C/C++ Source or Header  |  1990-10-01  |  7KB  |  211 lines

  1. #define VERSION "2.10gf"
  2. /* modified by Peter Damron 1987 University of Washington */
  3. /*---------------------------------------------------------------------*/
  4. /* $Header: dvi2ps.h,v 2.0 88/06/07 15:02:03 peterd Rel2 $ */
  5. /*---------------------------------------------------------------------*/
  6.  
  7. /**********************************************************************/
  8. /************************  Global Definitions  ************************/
  9. /**********************************************************************/
  10.  
  11. /* default font area (directory) */
  12. #ifndef FONTAREA
  13. #define  FONTAREA    "/usr/local/lib/tex/fonts"
  14. #endif
  15.  
  16. /* name for environment variable for tex font path/directory */
  17. #ifndef ENVTEXFONTS
  18. #define ENVTEXFONTS    "TEXFONTS"
  19. #endif
  20.  
  21. /* default header file location */
  22. #ifndef HDRFILE
  23. #define HDRFILE        "/usr/local/lib/tex.ps"
  24. #endif
  25.  
  26. #ifdef apollo
  27. #ifndef SPOOLFILE
  28. #define SPOOLFILE    "/local/spool/laser/tex."
  29. #endif
  30. #define MAXFLEN 28
  31. #endif apollo
  32.  
  33. #ifdef apollo
  34. #define  MAXOPEN     45    /* limit on number of open font files */
  35. #else !apollo
  36. #define  MAXOPEN     12    /* limit on number of open font files */
  37. #endif
  38.  
  39. #ifdef apollo       /* define for enabling of -c option (create output file) */
  40. #define CREOPT
  41. #endif apollo
  42.  
  43. #define USEGLOBALMAG 1            /* when defined, the dvi global */
  44.                     /*   magnification is applied   */
  45.     /* We can leave USEGLOBALMAG undefined when we have a limited
  46.        number of font magnifications (at 300dpi) available.  Otherwise, we
  47.        will simply complain about missing font files
  48.      */
  49. /* #undef USEGLOBALMAG */
  50.     /* define for "optimal" relative postioning, rather
  51.        than absolute.  Relative can reduce size of postcript
  52.        output 20% (and reduce print time by almost as much */
  53.  
  54. #define USERELPOS    1 
  55.  
  56. #define DEBUG   1            /* for massive printing of input */
  57.                     /* trace information; select by -d */
  58.                     /* option after filename: */
  59.                     /* dviview filename -d */
  60. #define STATS        /* to enable statistics reporting via -s option */
  61.  
  62. #define BINARYOPEN fopen        /* byte-oriented host version */
  63.  
  64. #define ARITHRSHIFT 1       /* define if ">>" operator is a */
  65.                     /* sign-propagating arithmetic  */
  66.                     /*   right shift */
  67.  
  68. #define  RESOLUTION      300
  69. #define  hconvRESOLUTION 300
  70. #define  vconvRESOLUTION 300
  71.  
  72. #ifdef NOTDEF
  73. #define  NPXLCHARS    128
  74. #define  PXLID        1001
  75. #endif NOTDEF
  76.  
  77. #define  DVIFORMAT    2
  78.  
  79. #define  STACKSIZE    100
  80. #define  STRSIZE    257
  81. #define  PATHSIZE    50
  82.  
  83. #define  NONEXISTANT    -1    /* offset for font files not found */
  84. #define  NO_FILE    (FILE *)-1
  85.  
  86. #define  TRUE        1
  87. #define  FALSE        0
  88.  
  89. /* define constants for fseek() */
  90. #define FROM_START    0
  91. #define FROM_HERE    1
  92. #define FROM_END    2
  93. #define READ        4        /* for access() */
  94.  
  95.  
  96. /**********************************************************************/
  97. /*************************  Global Procedures  ************************/
  98. /**********************************************************************/
  99. /* Note: Global procedures are declared here in alphabetical order, with
  100.    those which do not return values typed "void".  Their bodies occur in
  101.    alphabetical order following the main() procedure.  The names are
  102.    kept unique in the first 6 characters for portability.
  103.  */
  104.  
  105. float    ActualFactor();
  106. void    AllDone();
  107. FILE*    BINARYOPEN();
  108. int     ChkOpt();        /* Check PostScript option for validity */
  109. void    CopyFile();        /* copy a file to stdout */
  110. void    DecodeArgs();        /* process command line options */
  111. void    DoSpecial();
  112. void    EmitCharBitMap();
  113. void    Fatal();        /* like printf for fatal errors - no return */
  114. void    FindPostAmble();
  115. void    GetBytes();        /* get a string from a file */
  116. void    GetFontDef();
  117. char   *GetKeyStr();
  118. int     GetKeyVal();
  119. int     HasBeenRead();    /* return true if this dvi font number has been read */
  120. int     IsSame();    /* comare strings ignoring case */
  121. void    lcase();    /* convert a string to lower case - doesn't work? */
  122. void    MoveDown();
  123. void    MoveOver();
  124. int     NoSignExtend();     /* see cautionary note in code, re arithmetic vs logical shifts */
  125. void    OpenFontFile();
  126. #ifdef CREOPT
  127. FILE*   OpenOutput();
  128. #endif CREOPT
  129. int    PixRound();
  130. void    Progress();    /* like printf for messages about progress */
  131. void    PutInt();
  132. int    ReadFontDef();
  133. void    CheckPreAmble();
  134. void    ReadPreAmble();
  135. void    ReadPostAmble();
  136. void    SetChar();
  137. void    SetFontNum();
  138. void    SetPosn();
  139. void    SetRule();
  140. void    SetString();
  141. int     SignExtend();    /* see cautionary note in code, re arithmetic vs logical shifts */
  142. void    SkipFontDef();
  143. void    Warning();    /* like printf for warnings */
  144.  
  145.  
  146. /*---------------------------------------------------------------------*/
  147. /**********************************************************************/
  148. /***********************  Font Data Structures  ***********************/
  149. /**********************************************************************/
  150.  
  151. typedef int BOOLEAN;
  152.  
  153. #ifdef NOTDEF
  154. struct char_entry {            /* character entry */
  155. #ifdef USEPXL
  156.     unsigned short width;    /* char width in pixels */
  157.     unsigned short height;    /* char height in pixels */
  158.     short xOffset;        /* char x offset in pixels */
  159.     short yOffset;        /* char y offset in pixels */
  160. #endif
  161.     struct {
  162.     int isloaded;
  163.     union {
  164.        int fileOffset;
  165.        long *pixptr;
  166.     } address;
  167.     } where;
  168.     int tfmw;                /* TFM width */
  169. };
  170.  
  171. struct font_entry {    /* font entry */
  172.    int dvi_fnum;    /* font number - from dvi file */
  173.    int dvi_check;    /* checksum - never checked */
  174.    int dvi_s;        /* font space size */
  175.    int dvi_d;        /* font design size */
  176.    int dvi_alen;    /* area length for font name */
  177.    int dvi_nlen;    /* device length */
  178.             /* dvi_alen + dvi_nlen == length of dvi_name (name) */
  179.    char dvi_name[STRSIZE];    /* FNT_DEF command parameters (??) (font name?) */
  180.    int font_space;    /* computed from FNT_DEF s parameter */
  181.    int font_mag;    /* computed from FNT_DEF s and d parameters */
  182.    char psname[STRSIZE]; /* PostScript name of the font */
  183.    char name[STRSIZE];    /* full name of font file */
  184.    FILE *font_file_id;  /* file identifier (NO_FILE if none) */
  185.    struct open_font_list *open_font_ptr;    /* entry in open font list */
  186. #ifdef USEPXL
  187.    int magnification;    /* magnification read from PXL file */
  188.    int designsize;    /* design size read from PXL file */
  189. #endif
  190.    struct char_entry ch[NPXLCHARS];    /* character information */
  191.    struct font_entry *next;        /* next font entry in list */
  192.    int ncdl;        /* # of different chars actually downloaded */
  193. #ifdef STATS
  194.    int nbpxl;        /* # of bytes of font data downloaded*/
  195.    int ncts;        /* total # of characters typeset */
  196.    int nopen;        /* total # of file opens performed */
  197.    int nclose;        /* total # of file opens performed */
  198. #endif
  199. };
  200.  
  201. struct open_font_list
  202. {
  203.     FILE *pixel_file_id;        /* file identifier */
  204.     struct font_entry *font_entry_ptr;    /* font entry (fast lookup) */
  205.     int use_count;            /* count of "opens" */
  206. };
  207. #endif NOTDEF
  208.  
  209. /*---------------------------------------------------------------------*/
  210.  
  211.